{% extends 'base.html' %}
{% block title %}热门文章{% endblock %}
{% block header %}热门文章列表{% endblock %}
{% block content %}
    {% for i in hot_articles %}
    <div class="card mb-2 mt-2 border-warning">
        <div class="card-body">
            <h4 class="card-title">
                <span class="badge badge-danger">
                    {{ i.get_category_display }}
                </span>
                <a href="/article/{{ i.article_id }}">{{i.title}}</a>
            </h4>
            <p class="card-text">
                {{ i.content|truncatechars:20 }}...
            </p>
            <small>
                {{ i.post_datetime }}
                阅读数：{{ i.read_count }}
            </small>
        </div>
    </div>
    {% endfor %}
{% endblock %}